package cn.iocoder.yudao.module.member.dal.mysql.auth;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.auth.MemberAuthDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.auth.vo.*;

/**
 * 会员认证大愚灸术学员 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface MemberAuthMapper extends BaseMapperX<MemberAuthDO> {

    default PageResult<MemberAuthDO> selectPage(MemberAuthPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberAuthDO>()
                .eqIfPresent(MemberAuthDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(MemberAuthDO::getStatus, reqVO.getStatus())
                .eqIfPresent(MemberAuthDO::getIdNumber, reqVO.getIdNumber())
                .betweenIfPresent(MemberAuthDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberAuthDO::getId));
    }

    default List<MemberAuthDO> selectList(MemberAuthExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<MemberAuthDO>()
                .eqIfPresent(MemberAuthDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(MemberAuthDO::getStatus, reqVO.getStatus())
                .eqIfPresent(MemberAuthDO::getIdNumber, reqVO.getIdNumber())
                .betweenIfPresent(MemberAuthDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberAuthDO::getId));
    }

}
